package com.zone.session.defaults;

import com.zone.session.Configuration;
import com.zone.session.SqlSession;
import com.zone.session.SqlSessionFactory;

/**
 * @author: zongzi
 * @description: SQLSession抽象工厂默认实现
 * @date: 2023/11/29
 */
public class DefaultSqlSessionFactory implements SqlSessionFactory {
    // 映射器注册器用户构造默认的sqlSession实例时使用
    private final Configuration configuration;

    public DefaultSqlSessionFactory(Configuration configuration) {
        this.configuration = configuration;
    }

    @Override
    public SqlSession openSession() {
        return new DefaultSqlSession(configuration);
    }
}
